# -*- coding: utf-8 -*-
__author__ = 'JK'
__date__ = '2019/2/27 21:23'

from rest_framework import serializers

from .models import Testcase, Apicase

class CaseSerializer(serializers.ModelSerializer):
    user = serializers.HiddenField(
        default=serializers.CurrentUserDefault()
    )
    add_time = serializers.DateTimeField(read_only=True, format='%Y-%m-%d %H:%M:%S')
    for_product = serializers.CharField(read_only=True)
    for_project = serializers.CharField(read_only=True)
    case_actual_results = serializers.CharField(read_only=True)

    class Meta:
        model = Testcase
        fields = "__all__"


class ApicaseSerializer(serializers.ModelSerializer):
    user = serializers.HiddenField(
        default=serializers.CurrentUserDefault()
    )
    add_time = serializers.DateTimeField(read_only=True, format='%Y-%m-%d %H:%M:%S')

    class Meta:
        model = Apicase
        fields = "__all__"